<!DOCTYPE html>
<html  lang="en">
    <head>
        <title>Document</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
        <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css">   
        <script src="https://unpkg.com/swiper/swiper-bundle.min.js"> </script>
        <style>
            .swiper-container{
                width: 100%;
                height: 200px;
            }
        </style>
    </head>
    <body>
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <!-- 等待加载后端传来轮播图的数据 -->

            </div>

            <!-- 如果需要分页器 -->
            <div class="swiper-pagination"></div>

        </div>

        <script>
            setTimeout(function(){
                let datalist = ["111","222","333"]                                                  // 模拟数据内容
                let newlist = datalist.map( item => `<div class="swiper-slide">${item}</div>` )     // 创建需要挂载的DOM节点
                document.querySelector(".swiper-wrapper").innerHTML = newlist.join('')              // 渲染挂载DOM节点
                new Swiper(".swiper-container",
                {
                    autoplay: {
                        delay: 2500,
                        disableOnInteraction: false,
                    },
                    pagination: {
                        el: '.swiper-pagination',
                    }
                })
            },2000)
        </script>
    </body>
</html>